window.onload = function () {
    secondKill()
}
// 秒杀倒计时
var secondKill = function () {
    let parentTime = document.getElementsByClassName('sk_time')[0];
    let timeList = parentTime.getElementsByClassName('num');
    let times = 2 * 60 * 60;
    console.log(times);
    setInterval(function () {
        times--;
        let hours = Math.floor(times / (60 * 60));
        let minutes = Math.floor(times / 60 % 60);
        let seconds = times % 60;
        timeList[0].innerHTML = hours > 10 ? Math.floor(hours / 10) : 0;
        timeList[1].innerHTML = hours % 10;
        timeList[2].innerHTML = minutes > 10 ? Math.floor(minutes / 10) : 0;
        timeList[3].innerHTML = minutes % 10;
        timeList[4].innerHTML = seconds > 10 ? Math.floor(seconds / 10) : 0;
        timeList[5].innerHTML = seconds % 10;
    }, 1000);
};